<!DOCTYPE html>
<!--conf
<sample>
              <product version="4.0b1" edition="std"/>
                     <modifications>
                            <modified date="130911"/>
                     </modifications>
               </sample>
-->
<html>
<head>
	<title>Iterator</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<script>
		var names = {
			0: ["a","b","c"],
			1: ["The Dead Zone", "The Green Mile", "The Invisible Man"]
		}
		var nameIndex = 1;
		var myAcc;
		function doOnLoad() {
			myAcc = new dhtmlXAccordion("accObj");
			for (var q=0; q<names[0].length; q++) myAcc.addItem("a"+q, names[0][q], q==0);
		}
		function setText() {
			var k = 0;
			myAcc.forEachItem(function(cell){
				cell.setText(names[nameIndex%2][k++]);
			});
			nameIndex++;
		}
	</script>
</head>
<body onload="doOnLoad();">
		<div id="accObj" style="position: relative; width: 320px; height: 400px;"></div>
		<div style="margin: 50px 0px 20px 0px;">
			<input type="button" value="Set Text" onclick="setText();">
		</div>
</body>
</html>
